const {DataTypes} = require("sequelize");

const seq = require("../db/seq");
// 创建模型(Model zd_user -> 表 zd_users)
const Record = seq.define(
    "record",
    {
        // id 会被sequelize自动创建, 管理
        love: {
            type: DataTypes.INTEGER,
            allowNull: true,
            comment: "点赞次数",
            defaultValue: 0,
        },
        view: {
            type: DataTypes.INTEGER,
            allowNull: true,
            comment: "浏览次数",
            defaultValue: 0,
        },
        collect: {
            type: DataTypes.INTEGER,
            allowNull: true,
            comment: "收藏次数",
            defaultValue: 0,
        },
    },
    {
        paranoid: true,
    }
);

// 强制同步数据库(创建数据表)
// Record.sync({ force: true });

module.exports = Record;
